﻿<UserControl
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2006" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d"
    x:Class="C4F.VistaP2P.WPF.Network.NetworkManager"
    Loaded="NetworkManager_Loaded">
    <UserControl.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="Simple Styles.xaml"/>
                <ResourceDictionary Source="BlueResource.xaml"/>
            </ResourceDictionary.MergedDictionaries>

            <LinearGradientBrush x:Key="backgroundBrush" EndPoint="0.501,0.774" StartPoint="0.494,-0.174">
                <GradientStop Color="#FF3A3060" Offset="1"/>
                <GradientStop Color="#FF3640BA" Offset="0.276"/>
            </LinearGradientBrush>

            <!-- SimpleButtonFocusVisual is used to show keyboard focus around a SimpleButton control -->
            <Style x:Key="SimpleButtonFocusVisual">
                <Setter Property="Control.Template">
                    <Setter.Value>
                        <ControlTemplate>
                            <Border>
                                <Rectangle Margin="2" Stroke="#60000000" StrokeThickness="1" StrokeDashArray="1 2"/>
                            </Border>
                        </ControlTemplate>
                    </Setter.Value>
                </Setter>
            </Style>

            <!-- NormalBrush is used as the Background for SimpleButton, SimpleRepeatButton -->
            <LinearGradientBrush x:Key="NormalBrush" EndPoint="0,1" StartPoint="0,0">
                <GradientStop Color="#EEE" Offset="0.0"/>
                <GradientStop Color="#CCC" Offset="1.0"/>
            </LinearGradientBrush>
            <LinearGradientBrush x:Key="NormalBorderBrush" EndPoint="0,1" StartPoint="0,0">
                <GradientStop Color="#CCC" Offset="0.0"/>
                <GradientStop Color="#444" Offset="1.0"/>
            </LinearGradientBrush>

            <!-- Disabled Brushes are used for the Disabled look of each control -->
            <SolidColorBrush x:Key="DisabledForegroundBrush" Color="#888"/>

            <!-- Simple Button - This control sets brushes on each state. Note that these brushes must be listed above since they are static resources -->
            <Style x:Key="ButtonStyle1" TargetType="{x:Type Button}" BasedOn="{x:Null}">
                <Setter Property="FocusVisualStyle" Value="{DynamicResource SimpleButtonFocusVisual}"/>
                <Setter Property="Background" Value="{DynamicResource NormalBrush}"/>
                <Setter Property="BorderBrush" Value="{DynamicResource NormalBorderBrush}"/>
                <Setter Property="Template">
                    <Setter.Value>
                        <ControlTemplate TargetType="{x:Type Button}">

                            <Grid x:Name="Grid">

                                <Rectangle Stroke="#FFFFFFFF" RadiusX="15" RadiusY="15" x:Name="rectangle" StrokeThickness="2" Fill="{DynamicResource blueGradient}"/>

                                <ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" RecognizesAccessKey="True" OpacityMask="{x:Null}"/>

                                <!-- Content Presenter is where the text content etc is placed by the control -->
                            </Grid>

                            <!--Each state sets a brush on the Border in the template -->
                            <ControlTemplate.Triggers>
                                <Trigger Property="IsKeyboardFocused" Value="true"/>
                                <Trigger Property="IsMouseOver" Value="true">
                                    <Setter Property="Fill" TargetName="rectangle">
                                        <Setter.Value>
                                            <LinearGradientBrush EndPoint="0.496,1.002" StartPoint="0.453,-0.109">
                                                <GradientStop Color="#FF2F7BD1" Offset="0"/>
                                                <GradientStop Color="#FF0D3374" Offset="1"/>
                                            </LinearGradientBrush>
                                        </Setter.Value>
                                    </Setter>
                                </Trigger>
                                <EventTrigger RoutedEvent="FrameworkElement.Loaded"/>
                                <Trigger Property="IsPressed" Value="true">
                                    <Setter Property="Background">
                                        <Setter.Value>
                                            <LinearGradientBrush EndPoint="0,1" StartPoint="0,0">
                                                <GradientStop Color="#FFEEEEEE" Offset="0"/>
                                                <GradientStop Color="#FF39CF6B" Offset="1"/>
                                                <GradientStop Color="#FFE7E7E7" Offset="0.202"/>
                                                <GradientStop Color="#FF39CF6B" Offset="0.205"/>
                                            </LinearGradientBrush>
                                        </Setter.Value>
                                    </Setter>
                                    <Setter Property="Fill" TargetName="rectangle">
                                        <Setter.Value>
                                            <LinearGradientBrush EndPoint="0.468,-0.109" StartPoint="0.481,1.002">
                                                <GradientStop Color="#FF006900" Offset="0"/>
                                                <GradientStop Color="#FF39CF6B" Offset="1"/>
                                            </LinearGradientBrush>
                                        </Setter.Value>
                                    </Setter>
                                </Trigger>
                                <Trigger Property="IsEnabled" Value="true"/>
                                <Trigger Property="IsEnabled" Value="false">
                                    <Setter Property="Foreground" Value="{DynamicResource DisabledForegroundBrush}"/>
                                    <Setter Property="IsEnabled" TargetName="rectangle" Value="False"/>
                                    <Setter Property="Fill" TargetName="rectangle">
                                        <Setter.Value>
                                            <LinearGradientBrush EndPoint="0,1" StartPoint="0,0">
                                                <GradientStop Color="#FF9C9A9C" Offset="0"/>
                                                <GradientStop Color="#FF393439" Offset="1"/>
                                            </LinearGradientBrush>
                                        </Setter.Value>
                                    </Setter>
                                </Trigger>
                            </ControlTemplate.Triggers>
                        </ControlTemplate>
                    </Setter.Value>
                </Setter>
            </Style>

            <LinearGradientBrush x:Key="font" EndPoint="0.494,-0.136" StartPoint="0.506,1.136">
                <GradientStop Color="#FFADADAD" Offset="0"/>
                <GradientStop Color="#FFFFFFFF" Offset="1"/>
            </LinearGradientBrush>

            <LinearGradientBrush x:Key="blueGradient" EndPoint="0.468,-0.109" StartPoint="0.481,1.002">
                <GradientStop Color="#FF2F7BD1" Offset="0"/>
                <GradientStop Color="#FF0D3374" Offset="1"/>
            </LinearGradientBrush>

            <LinearGradientBrush x:Key="topBlueGradient" EndPoint="0.0,0" StartPoint="0.0,1.00">
                <GradientStop Color="#FF2F7BD1" Offset="0"/>
                <GradientStop Color="#FF0D3374" Offset="1"/>
            </LinearGradientBrush>
            <Storyboard x:Key="OnLoaded1">
                <ColorAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="progressBar1" Storyboard.TargetProperty="(TextElement.Foreground).(SolidColorBrush.Color)">
                    <SplineColorKeyFrame KeyTime="00:00:00" Value="#FF2165B5"/>
                </ColorAnimationUsingKeyFrames>
            </Storyboard>
        </ResourceDictionary>
    </UserControl.Resources>

    <UserControl.Triggers>
        <EventTrigger RoutedEvent="FrameworkElement.Loaded" SourceName="progressBar1">
            <BeginStoryboard Storyboard="{StaticResource OnLoaded1}"/>
        </EventTrigger>
    </UserControl.Triggers>

    <Grid Width="Auto" Height="Auto">

        <Rectangle Stroke="{DynamicResource font}" RadiusX="15" RadiusY="15" StrokeThickness="2" Fill="#FF000000"/>

        <Grid Height="Auto" Width="Auto" Margin="0,0,0,8">
            <Grid.RowDefinitions>
                <RowDefinition Height="20"/>
                <RowDefinition Height="0"/>
                <RowDefinition Height="25" MinHeight="20"/>
                <RowDefinition Height="25" MinHeight="20"/>
                <RowDefinition Height="25" MinHeight="20"/>
                <RowDefinition Height="*"/>
                <RowDefinition Height="69"/>
            </Grid.RowDefinitions>
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="Auto" MinWidth="78.213"/>
                <ColumnDefinition Width="0.258*"/>
                <ColumnDefinition Width="0.742*"/>
            </Grid.ColumnDefinitions>

            <TextBox FontFamily="Calisto MT" Text="" FontWeight="Bold" Opacity="1" IsEnabled="True" TextWrapping="Wrap" FontStyle="Normal" x:Name="tbUserName" BorderThickness="0,0,0,0" Padding="0,0,0,0" HorizontalContentAlignment="Left" VerticalScrollBarVisibility="Disabled" Grid.IsSharedSizeScope="False"  BorderBrush="{x:Null}" AcceptsReturn="True" FontSize="12" Grid.Row="2" Margin="5,6,10,6" Background="#FFFFFFFF" Grid.Column="1" VerticalAlignment="Stretch" VerticalContentAlignment="Center" Grid.ColumnSpan="2" d:LayoutOverrides="GridBox" />
            <Label Focusable="False" Content="User Name" Background="{x:Null}" BorderBrush="{x:Null}" Foreground="#FFFFFFFF" FontSize="11" x:Name="lblUserName" Grid.Row="2" Padding="0,0,0,0" RenderTransformOrigin="0.587,0.067" d:LayoutOverrides="HorizontalAlignment" Margin="16,3.185,5,3.185"/>

            <Rectangle StrokeThickness="1" RadiusX="0" RadiusY="0" Grid.ColumnSpan="3" Stroke="#FF000000" Margin="0,0,17,0" x:Name="topLeftBlue" Fill="{DynamicResource topBlueGradient}" d:LayoutOverrides="GridBox">
                <Rectangle.Clip>
                    <PathGeometry>
                        <PathFigure IsClosed="True" StartPoint="1,16">
                            <BezierSegment Point1="1,7.7157287525381" Point2="7.7157287525381,1" Point3="16,1" IsSmoothJoin="True"/>
                            <LineSegment IsSmoothJoin="True" Point="336,1"/>
                            <BezierSegment Point1="344.284271247462,1" Point2="351,7.7157287525381" Point3="351,16" IsSmoothJoin="True"/>
                            <LineSegment IsSmoothJoin="True" Point="351,128"/>
                            <BezierSegment Point1="351,136.284271247462" Point2="344.284271247462,143" Point3="336,143" IsSmoothJoin="True"/>
                            <LineSegment IsSmoothJoin="True" Point="16,143"/>
                            <BezierSegment Point1="7.7157287525381,143" Point2="1,136.284271247462" Point3="1,128" IsSmoothJoin="True"/>
                        </PathFigure>
                    </PathGeometry>
                </Rectangle.Clip>
            </Rectangle>

            <Rectangle StrokeThickness="1" RadiusX="0" RadiusY="0" Stroke="{x:Null}" x:Name="topRightBlue" ClipToBounds="False" StrokeEndLineCap="Flat" RenderTransformOrigin="0.5,0.5" Margin="6.649,0,0,0" Stretch="Fill" Fill="{DynamicResource topBlueGradient}" Grid.Column="2">
                <Rectangle.Clip>
                    <PathGeometry>
                        <PathFigure IsClosed="True" StartPoint="1,16">
                            <BezierSegment Point1="1,7.7157287525381" Point2="7.7157287525381,1" Point3="16,1" IsSmoothJoin="True"/>
                            <LineSegment IsSmoothJoin="True" Point="336,1"/>
                            <BezierSegment Point1="344.284271247462,1" Point2="351,7.7157287525381" Point3="351,16" IsSmoothJoin="True"/>
                            <LineSegment IsSmoothJoin="True" Point="351,128"/>
                            <BezierSegment Point1="351,136.284271247462" Point2="344.284271247462,143" Point3="336,143" IsSmoothJoin="True"/>
                            <LineSegment IsSmoothJoin="True" Point="16,143"/>
                            <BezierSegment Point1="7.7157287525381,143" Point2="1,136.284271247462" Point3="1,128" IsSmoothJoin="True"/>
                        </PathFigure>
                    </PathGeometry>
                </Rectangle.Clip>
                <Rectangle.RenderTransform>
                    <TransformGroup>
                        <ScaleTransform ScaleX="-1" ScaleY="1"/>
                        <SkewTransform AngleX="0" AngleY="0"/>
                        <RotateTransform Angle="0"/>
                        <TranslateTransform X="0" Y="0"/>
                    </TransformGroup>
                </Rectangle.RenderTransform>
            </Rectangle>

            <Rectangle StrokeThickness="1" RadiusX="0" RadiusY="0" Stroke="{x:Null}" x:Name="topCenterBlue" Fill="{DynamicResource topBlueGradient}" HorizontalAlignment="Stretch" Width="Auto" Margin="60,0,40,0" Grid.ColumnSpan="3" d:LayoutOverrides="GridBox"/>

            <Path VerticalAlignment="Bottom" Height="2" Stretch="Fill" Stroke="#FFFFFFFF" StrokeThickness="2" Grid.ColumnSpan="3" Data="M-0.5,30 L351.5,30" Margin="0,0,0,0" d:LayoutOverrides="GridBox"/>

            <TextBox FontFamily="Calisto MT" Text=" " FontWeight="Bold" Opacity="1" IsEnabled="True" TextWrapping="Wrap" FontStyle="Normal" x:Name="tbPassword" BorderThickness="0,0,0,0" Padding="0,0,0,0" HorizontalContentAlignment="Left" VerticalScrollBarVisibility="Disabled" Grid.IsSharedSizeScope="False"  BorderBrush="{x:Null}" AcceptsReturn="True" FontSize="12" Margin="5,6,10,6" Background="#FFFFFFFF" Grid.Row="3" Grid.Column="1" VerticalAlignment="Stretch" VerticalContentAlignment="Center" Grid.ColumnSpan="2" d:LayoutOverrides="GridBox" />

            <TextBox FontFamily="Calisto MT" Text="" FontWeight="Bold" Opacity="1" IsEnabled="True" TextWrapping="Wrap" FontStyle="Normal" x:Name="tbNetwork" BorderThickness="0,0,0,0" Padding="0,0,0,0" HorizontalContentAlignment="Left" VerticalScrollBarVisibility="Disabled" Grid.IsSharedSizeScope="False"  BorderBrush="{x:Null}" AcceptsReturn="True" FontSize="12" Margin="5,6,10,6" Background="#FFFFFFFF" Grid.Row="4" Grid.Column="1" VerticalAlignment="Stretch" VerticalContentAlignment="Center" Grid.ColumnSpan="2" d:LayoutOverrides="GridBox" />

            <Label Focusable="False" Content="Password" Background="{x:Null}" BorderBrush="{x:Null}" Foreground="#FFFFFFFF" FontSize="11" x:Name="lblPassword" Padding="0,0,0,0" RenderTransformOrigin="0.587,0.067" d:LayoutOverrides="GridBox" Margin="14,3.185,0,3.185" Grid.Row="3" HorizontalAlignment="Left"/>

            <Label Focusable="False" Content="Network" Background="{x:Null}" BorderBrush="{x:Null}" Foreground="#FFFFFFFF" FontSize="11" x:Name="lblNetwork" Padding="0,0,0,0" RenderTransformOrigin="0.587,0.067" Height="18.63" d:LayoutOverrides="GridBox" Margin="14,3.185,0,3.185" Grid.Row="4" HorizontalAlignment="Left"/>

            <Button Style="{DynamicResource ButtonStyle1}" x:Name="btnSignInButton" Content="Sign In" Foreground="{DynamicResource font}" Margin="0,0,10,10" Grid.Row="6" Width="55" FontSize="12" Grid.Column="2" Height="50" HorizontalAlignment="Right" VerticalAlignment="Bottom">
                <Button.Background>
                    <LinearGradientBrush EndPoint="0,1" StartPoint="0,0">
                        <GradientStop Color="#FFEEEEEE" Offset="0"/>
                        <GradientStop Color="#FFCCCCCC" Offset="1"/>
                        <GradientStop Color="#FFE7E7E7" Offset="0.202"/>
                        <GradientStop Color="#FFE6E6E6" Offset="0.205"/>
                    </LinearGradientBrush>
                </Button.Background>
            </Button>

            <Label Focusable="False" Content="Disconnected..." Background="{x:Null}" BorderBrush="{x:Null}" Foreground="#FFFFFFFF" FontSize="11" x:Name="lblStatusValue" Padding="0,0,0,0" RenderTransformOrigin="0.587,0.067" Height="Auto" d:LayoutOverrides="Height" Grid.Row="6" Margin="53.271,9,0,0" Grid.ColumnSpan="3" HorizontalAlignment="Left" VerticalAlignment="Top"/>

            <Label Focusable="False" Content="Status:" Background="{x:Null}" BorderBrush="{x:Null}" Foreground="{DynamicResource blueFontBrush}" FontSize="11" x:Name="lblStatus" Padding="0,0,0,0" RenderTransformOrigin="0.587,0.067" Margin="14,9,0,0" Grid.Row="6" d:LayoutOverrides="Width" FontWeight="Bold" HorizontalAlignment="Left" VerticalAlignment="Top" Height="18.63"/>

            <TextBox Margin="10,-3.166,29.72,2" Text="Network" TextWrapping="Wrap" BorderBrush="{x:Null}" Height="Auto" Width="Auto" x:Name="Title" Padding="0,0,0,0" Background="{x:Null}" Foreground="{DynamicResource font}" FontSize="15" VerticalContentAlignment="Top" d:LayoutOverrides="Width" Grid.ColumnSpan="2"/>

            <ProgressBar Grid.Row="6" x:Name="progressBar1" Grid.ColumnSpan="2" HorizontalAlignment="Left" VerticalAlignment="Bottom" Margin="55,0,0,33" Height="10" Width="70" />

        </Grid>

        <Rectangle Stroke="{DynamicResource font}" RadiusX="15" RadiusY="15" StrokeThickness="2" Fill="{x:Null}" d:IsHidden="True"/>

    </Grid>

</UserControl>
